curl --request POST \
--url http:///%7B{baseurl}%7D/api/v1/client/{environmentId}/user \
--header 'Content-Type: application/json' \
--data '{
"attributes": {
"plan": "free"
},
"userId": "hello-user"
}'
{
"data": {
"state": {
"data": {
"displays": [
{
"createdAt": "2025-02-03T11:23:13.050Z",
"surveyId": "cm6orqtdd000a19wjhnbces5s"
}
],
"lastDisplayAt": "2025-02-03T11:23:13.050Z",
"responses": [
"cm6orqtdd000a19wjhnbces5s"
],
"segments": [
"cm6onrezn000hw2ahcokiz41v"
],
"userId": "hello-user"
},
"expiresAt": "2025-02-03T11:23:13.050Z"
}
}
}
Endpoint for creating or identifying a user within the specified environment. If the user already exists, this will identify them and potentially update user attributes. If they don’t exist, it will create a new user.
curl --request POST \
--url http:///%7B{baseurl}%7D/api/v1/client/{environmentId}/user \
--header 'Content-Type: application/json' \
--data '{
"attributes": {
"plan": "free"
},
"userId": "hello-user"
}'
{
"data": {
"state": {
"data": {
"displays": [
{
"createdAt": "2025-02-03T11:23:13.050Z",
"surveyId": "cm6orqtdd000a19wjhnbces5s"
}
],
"lastDisplayAt": "2025-02-03T11:23:13.050Z",
"responses": [
"cm6orqtdd000a19wjhnbces5s"
],
"segments": [
"cm6onrezn000hw2ahcokiz41v"
],
"userId": "hello-user"
},
"expiresAt": "2025-02-03T11:23:13.050Z"
}
}
}
OK
The response is of type object
.
Was this page helpful?